 #@layout()
 #define content()

<span class="layui-breadcrumb">
  <a href="/">首页</a>
  <a href="/admin/log"><cite>日志管理</cite></a>
</span>

<hr>


<div class="layui-field-box">
<form class="layui-form" action="/admin/user">
    <div class="layui-form-item">
    		<div class="layui-inline">
	      <label class="layui-form-label">搜索内容</label>
	      <div class="layui-input-inline">
	        <input type="text" name="searchContent" autocomplete="off" class="layui-input" placeholder="请输入内容搜索">
	      </div>
	    </div>
	    
	    <button class="layui-btn" type="button" id="btnSearch">搜索</button>
	    <button class="layui-btn layui-btn-normal" type="reset" >重置</button>
	    
	</div>
</form>	    
</div>
  
<table class="layui-hide" id="dataTable"></table>
  
#end

#define js()

<script>

layui.use('table', function() {
	
	var table = layui.table;
	table.render({
		elem : '#dataTable',
		url : '/admin/log/pagequery',
		cols : [ [
	      {field:'username', title: '操作人'},
	      {field:'email', title: '邮箱'},
	      {field:'cellphone', title: '手机号'},
	      {field:'createTime', title: '创建时间'},
	      {field:'startTime', title: '开始时间'},
	      {field:'endTime', title: '结束时间'},
	      {field:'actionTime', title: '用时(毫秒)'},
	      {field:'method', title: 'Method'},
	      {field:'ip', title: 'IP'},
	      {field:'auth', title: '是否授权'},
	      {field:'url', title: 'URL'},
	      
		] ],
		page : true
	});
	
	$("#btnSearch").click(function(){
		
		var searchContent=$(":input[name='searchContent']").val();
		var status=$(":input[name='status']").val();
		
		//执行重载
		table.reload('dataTable', {
			page : {
				curr : 1//重新从第 1 页开始
			},
			where : {
				searchContent:searchContent,
				status:status
			}
		});
		
	});

});


</script>

#end


